package com.yhq.thrift.demo.springclient;

import com.yhq.thrift.client.ThriftConnectionFactory;
import com.yhq.thrift.client.ThriftProxy;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import tutorial.Calculator;

import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;

/**
 * Created by yhq on 2016/12/7.
 */
@Component
public class ThriftProxyFactory {

    @Autowired
     private ThriftConnectionFactory thriftConnectionFactory;

    public Calculator.Iface getCalculator() throws Exception{
        return new ThriftProxy<Calculator.Iface>(thriftConnectionFactory){}.createProxy();
    }
}
